package com.sinopec.yelofixedreader.uhf.api

import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import com.sinopec.basemodule.http.HttpParamObj
import com.sinopec.basemodule.http.api.HttpResult
import com.sinopec.basemodule.http.api.RetroAPIFactory
import com.sinopec.yelofixedreader.uhf.model.GetTrayCodeRegexResponseDto
import io.reactivex.Observable

object RFIDApi {

    private val iService: RFIDService by lazy {
        RetroAPIFactory.create(RFIDService::class.java)
    }
    private val gson: Gson by lazy { Gson() }
    private val parseType = object : TypeToken<HashMap<String, Any?>>() {}.type

    /**
     * rfid 编码规则
     */
    fun rfidRule(): Observable<HttpResult<GetTrayCodeRegexResponseDto>> {
        return iService.rfidRule(HttpParamObj.createParams().end())
    }

}